﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmListaDeContactos.aspx.cs" Inherits="frmListaDeContactos" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style3
        {
           font-weight: normal;
        }
        .style4
        {
            font-weight: normal;
            font-size: x-large;
            color: #0000FF;
        }
        .style5
        {
            margin-right: 407;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        &nbsp;</p>
    <p class="style4">
        <strong>Lista De Contactos</strong></p>
    <p>
        &nbsp;</p>
    <p>
        <asp:GridView ID="GridView1" runat="server" 
            AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
            BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" 
            CellSpacing="1" DataSourceID="SqlDataSource1" GridLines="None" 
            onselectedindexchanged="GridView1_SelectedIndexChanged1" PageSize="15" 
            CssClass="style5" Width="1095px">
            <Columns>
                <asp:CommandField ShowSelectButton="True" ButtonType="Image" 
                    SelectImageUrl="~/Img/ico_chico_ok.png" />
                <asp:BoundField DataField="Empresa" HeaderText="Empresa" 
                    SortExpression="Empresa" />
                <asp:BoundField DataField="Tel. Empresa" HeaderText="Tel. Empresa" 
                    SortExpression="Tel. Empresa" />
                <asp:BoundField DataField="Apellido" HeaderText="Apellido" 
                    SortExpression="Apellido" />
                <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                    SortExpression="Nombre" />
                <asp:BoundField DataField="DNI" HeaderText="DNI" 
                    SortExpression="DNI" />
                <asp:BoundField DataField="Telefono" HeaderText="Telefono" 
                    SortExpression="Telefono" />
                <asp:BoundField DataField="E-Mail" HeaderText="E-Mail" 
                    SortExpression="E-Mail" />
                <asp:BoundField DataField="Calle" HeaderText="Calle" SortExpression="Calle" />
                <asp:BoundField DataField="Nro." HeaderText="Nro." SortExpression="Nro." />
                <asp:BoundField DataField="Piso" HeaderText="Piso" SortExpression="Piso" />
                <asp:BoundField DataField="Dpto." HeaderText="Dpto." SortExpression="Dpto." />
                <asp:BoundField DataField="Barrio" HeaderText="Barrio" 
                    SortExpression="Barrio" />
                <asp:BoundField DataField="Localidad" HeaderText="Localidad" 
                    SortExpression="Localidad" />
                <asp:BoundField DataField="Observaciones" HeaderText="Observaciones" 
                    SortExpression="Observaciones" />
            </Columns>
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#594B9C" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#33276A" />
        </asp:GridView>
    </p>
    <p>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
    <p>
        &nbsp;</p>
    <p>
        <asp:Button ID="Button3" runat="server" Height="31px" onclick="Button3_Click" 
            Text="Listar Contactos" Width="186px" />
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
            
            SelectCommand="SELECT T_Empresa.razonSocial AS Empresa, T_Empresa.numTelefono AS [Tel. Empresa], T_Contacto.apellido AS Apellido, T_Contacto.nombre AS Nombre, T_Contacto.numDocumento AS DNI, T_Contacto.numTelefono AS Telefono, T_Contacto.dirCorreo AS [E-Mail], T_Contacto.calle AS Calle, T_Contacto.numeroCalle AS [Nro.], T_Contacto.piso AS Piso, T_Contacto.departamento AS [Dpto.], T_Barrio.nombreBarrio AS Barrio, T_Localidad.nombreLocalidad AS Localidad, T_Contacto.observaciones AS Observaciones, T_Empresa.*, T_Contacto.* FROM T_Contacto INNER JOIN T_Empresa ON T_Contacto.cuit = T_Empresa.cuit INNER JOIN T_Barrio ON T_Contacto.idBarrio = T_Barrio.idBarrio INNER JOIN T_Localidad ON T_Contacto.idLocalidad = T_Localidad.idLocalidad">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            
            SelectCommand="SELECT T_Empresa.nombreComercial AS Empresa, T_Contacto.numDocumento AS DNI, T_Contacto.nombre AS Nombre, T_Contacto.apellido AS Apellido, T_Contacto.dirCorreo AS [E-Mail], T_Contacto.numTelefono AS Telefono, T_Contacto.fechaNacimiento AS [Fecha Nac.], T_Contacto.observaciones AS Observaciones, T_Contacto.calle AS Calle, T_Contacto.numeroCalle AS [Nro.], T_Contacto.piso AS Piso, T_Contacto.departamento AS [Dpto.], T_Barrio.nombreBarrio AS Barrio, T_Localidad.nombreLocalidad AS Localidad, T_Empresa.razonSocial AS Expr1, T_Contacto.idContacto, T_Contacto.descripcionContacto, T_Contacto.cuit, T_Contacto.numDocumento, T_Contacto.nombre AS Expr2, T_Contacto.apellido AS Expr3, T_Contacto.idTipoDocumento, T_Contacto.dirCorreo, T_Contacto.idTipoTelefono, T_Contacto.numTelefono, T_Contacto.fechaNacimiento, T_Contacto.observaciones AS Expr4, T_Contacto.calle AS Expr5, T_Contacto.numeroCalle, T_Contacto.piso AS Expr6, T_Contacto.departamento, T_Contacto.codPostal, T_Contacto.idBarrio AS Expr20, T_Contacto.idLocalidad AS Expr21, T_Contacto.idProvincia AS Expr22, T_Contacto.idPais AS Expr23, T_Empresa.cuit AS Expr7, T_Empresa.razonSocial, T_Empresa.nombreComercial, T_Empresa.dirCorreo AS Expr8, T_Empresa.dirWeb, T_Empresa.numTelefono AS Expr9, T_Empresa.idTipoTelefono AS Expr10, T_Empresa.idCondIva, T_Empresa.calle AS Expr11, T_Empresa.numeroCalle AS Expr12, T_Empresa.piso AS Expr13, T_Empresa.departamento AS Expr14, T_Empresa.codPostal AS Expr15, T_Empresa.idBarrio AS Expr16, T_Empresa.idLocalidad AS Expr17, T_Empresa.idProvincia AS Expr18, T_Empresa.idPais AS Expr19, T_Provincia.nombreProvincia AS Expr24, T_Barrio.*, T_Localidad.*, T_Provincia.* FROM T_Contacto INNER JOIN T_Empresa ON T_Contacto.cuit = T_Empresa.cuit INNER JOIN T_Barrio ON T_Contacto.idBarrio = T_Barrio.idBarrio INNER JOIN T_Localidad ON T_Contacto.idLocalidad = T_Localidad.idLocalidad INNER JOIN T_Provincia ON T_Contacto.idProvincia = T_Provincia.idProvincia
where T_Contacto.numDocumento=@dni">
            <SelectParameters>
                <asp:ControlParameter ControlID="Label1" Name="dni" PropertyName="Text" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        <asp:Label ID="Label1" runat="server" Visible="False"></asp:Label>
    </p>
    <p>
        <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Volver" 
            Height="30px" Width="97px" />
    </p>
</asp:Content>

